package ca.jsbr.canvaswar.games.ui 
{
	import ca.jsbr.as2js_lib.display.animations.Tween;
	import ca.jsbr.as2js_lib.display.canvas.bitmap.imageFilter.Flip;
	import ca.jsbr.as2js_lib.display.canvas.CanvasStage;
	import ca.jsbr.as2js_lib.display.canvas.Node2D;
	import ca.jsbr.as2js_lib.display.canvas.view.Image;
	import ca.jsbr.as2js_lib.utils.assets.AssetsFactory;
	import ca.jsbr.canvaswar.games.unit.Unit;
	/**
	 * ...
	 * @author jsbr [jsricard@lvlstudio.com]
	 */
	public class BattleBox extends Node2D
	{
		private var _background:Image;
		
		public function BattleBox(unit:Unit, invert:Boolean = false)
		{
			
			if (invert)
			{
				_background = new Image(AssetsFactory.getInstance().getAssets("battlebox2"));
				x = CanvasStage.instance.width;
				y = + CanvasStage.instance.height * 0.5 - _background.height * 0.5;
			}
			else
			{
				_background = new Image(AssetsFactory.getInstance().getAssets("battlebox"));
				x = -_background.width;
				y = + CanvasStage.instance.height * 0.5 - _background.height * 0.5;
			}
			_width = _background.width;
			_height = _background.height;
			addChild(_background);
		}
		
	}

}